DirectoryI. Condition selection: If statementTwo. Conditional judgment: Case statementThree. For loopI. Condition selection: If statement
Single Branchif judgment condition; thenBranch code with true conditionFiExample: Judging whether a number
1. expr computes the integer variable valueS= ' Expr 2 + 3 'The arithmetic symbol and the parameter must have the space separate;2. Let command let s= (2+3) echo $s 3, for statement
For variable in list
An If expression
IF (EXPR1,EXPR2,EXPR3)
If Expr1 is true (expr1 <> 0 and Expr1 <> NULL), then the return value of if () is expr2; Otherwise, the return value is EXPR3. The return value of IF () is a numeric value or a string value, depending on
MySQL can be used as an expression, or as a Process control statement in a stored procedure, as an expression:An If expressionIF(expr1,expr2,expr3)If Expr1 is true (expr1 <> 0 and Expr1 <> NULL), then the return value of if () is expr2; Otherwise
If condition test statement
If-then-fiThe IF condition test statement runs the command after the if (judgment).If the exit status code for this command is 0, the command in the then section will be executed.If the exit status code for the
If, case, for, while, until, shellcase in Shell scripts
If condition test statement
If-then-fiIn the if condition test statement, the command following the if statement is run ).If the exit status code of the command is 0, the command in the then
Shell programming control structure: expr, let, for, while, until, shift, if, case, break, continue, function, select
1. expr calculates the integer variable value
S = 'expr 2 + 3'
The operator numbers and parameters must be separated by spaces;
2.
#!/bin/sh#--------------------------------------------------#Author: created by randolph 2016/10/21#blog:http://randolph.blog.51cto.com#function: this scripts function is create|remove#version:4.1.2#------------------------------------------------
1. Database design:For user-specific needs, then we create a most practical and high performance database!Steps for database design:01. Demand Analysis02. Conceptual Structure Design03. Logical Structure Design04. Physical Organization Design05.
In an SQL expression:An If expression:if (EXPR1,EXPR2,EXPR3) If Expr1 is true (expr1 <> 0 and Expr1 <> NULL), then the return value of if () is expr2; Otherwise the return value is EXPR3. The return value of IF () is a numeric value or a string
20.5 logical Judgments in shell scripts• format 1:if conditions; Then statement; FiExample: a=5If [$a-gt 3]; then echo OK; Fi[Email protected] shell]# sh If1.shok• format 2:if conditions; Then statement; else statement; FiExample: a=5If [$a-gt 3];
DirectoryI. Condition selection: If statementTwo. Conditional judgment: Case statementThree. For loopI. Condition selection: If statement
Single Branchif judgment condition; thenBranch code with true conditionFiExample: Judging whether a number
If syntax:if [expression]ThenCommandselif [Expression2]ThenCommandsElseCommandsFiCase Syntax: Case string1 inSTR1)commands;;STR2)commands;;*)Commans;;EsacLoop statement for syntax: for Var in listDoCommands done In this form, for each item in the
1, write script/root/bin/createuser.sh, to achieve the following functions: Use a user name as a parameter, if the user specified parameter exists, it will show its existence, otherwise add, and generate a 8-bit random password and there is a file,
1.ifExpression: IF (Expr1, EXPR2, EXPR3)The EXPR1 condition is true, the value is Expr2, false, and the value is EXPR3Cases:SELECT o.id,u.account,catagory. ' Name ', Ordertime,detail.amount,periodtime, if (direction='0',' bullish ',' bearish ' = = =
"Conditional judgment"1. Judging by file type-B file to determine if the file exists and is a block device file (is a block device file is true)-c file to determine if the file exists and is a character device file (the character device file is true)
-- MySQL stored procedure/* Set @ result = 0; Create procedure login (-- defines parameters, including in, out, And inout types in user varchar (10 ), in pass varchar (10), out result INT) Begin declare passd varchar (10); -- declare declares
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.